namespace FineCollection.Intf
{
    
    /// <summary>
    /// A simple read-only iterator.
    /// </summary>
    public interface RIterator<T>
    {

        /// <summary>
        /// Resets this iterator.
        /// <para>
        /// Initially, iterator points to "begin" state - "before" the first item.
        /// </para>
        /// </summary>
        void Reset();


        /// <summary>
        /// Moves to the next element.
        /// </summary>
        /// <returns>"true" if the pointer has moved to the next item,
        ///          "false" if it has moved to behind of all items.</returns>
        bool Next();
        

        /// <summary>
        /// The current item (read-only access).
        /// </summary>
        T Current { get; }


        /// <summary>
        /// Represents where the current position of the iterator.
        /// </summary>
        /// <remarks>
        /// Possible value:
        /// <list type="bullet">
        /// <item>-1: before the first item;</item>
        /// <item>0: at an item of the collection;</item>
        /// <item>+1: behind the last item.</item>
        /// </list>
        /// </remarks>
        sbyte Where { get; }


        /// <summary>
        /// Clones the iterator.
        /// </summary>
        /// <returns>an exact </returns>
        RIterator<T> Clone();
    }
    
}